package cn.wegoteam.shop.config;

import java.util.ArrayList;

import cn.wegoteam.shop.cache.Cache;
import cn.wegoteam.shop.enu.AgentType;
import cn.wegoteam.shop.enu.FlagType3;
import cn.wegoteam.shop.enu.NewsType;
import cn.wegoteam.shop.enu.UserType;
import cn.wegoteam.shop.util.Const;

public class MenuList {
    public static ArrayList<MenuListBean> firstmenu=null;
    static{
    	if(firstmenu==null){
    		firstmenu=new ArrayList<MenuListBean>();
    		MenuListBean b1=new MenuListBean("用户管理");
    		for(UserType type:UserType.values()){
				b1.addLink(type.getName(), "manageUserList?p_type="+type.name());
			}
    		firstmenu.add(b1);
    		MenuListBean b7=new MenuListBean("代理商管理");
    		for(AgentType type:AgentType.values()){
    			b7.addLink(type.getName(), "manageAgentList?p_type="+type.name());
    		}
    		firstmenu.add(b7);
    		MenuListBean b2=new MenuListBean("产品管理");
    		b2.addLink("全部", "manageProductList");
    	    b2.addLink("推荐", "");
    	    b2.addLink("促销产品", "");
    	    firstmenu.add(b2);
    	    MenuListBean b3=new MenuListBean("新闻管理");
    	    b3.addLink("置顶", "");
    	    
    	    MenuListBean news = new MenuListBean("新闻资讯");
			news.addLink(NewsType.INFOR.getName(), "manageNewsList?type="+NewsType.INFOR.name());
			news.addLink(NewsType.PAGE.getName(), "manageNewsList?type="+NewsType.PAGE.name());
			news.addLink(FlagType3.置顶.name(), "manageNewsList?flag="+FlagType3.置顶.getName());
    	    firstmenu.add(news);
    	    MenuListBean newsComment=new MenuListBean("新闻评论");
    	    newsComment.addLink("列表", "manageCommentList?cId=null");
    	    firstmenu.add(newsComment);
    	    MenuListBean hotWord = new MenuListBean("热词管理");
			hotWord.addLink(FlagType3.不可用.name(), "manageHotwordList?flag="+FlagType3.不可用.getName());
			hotWord.addLink(FlagType3.可用.name(), "manageHotwordList?flag="+FlagType3.可用.getName());
			hotWord.addLink(FlagType3.置顶.name(), "manageHotwordList?flag="+FlagType3.置顶.getName());
			firstmenu.add(hotWord);
    	    MenuListBean b4=new MenuListBean("订单管理");
    	    b4.addLink("全部订单", "manageOrderList");
    	    b4.addLink("可用订单", "");
    	    firstmenu.add(b4);
    	    MenuListBean b5=new MenuListBean("系统设置");
    	    b5.addLink("系统参数", "manageSettingList");
    	    b5.addLink("重建lucene索引", Cache.getSetting(Const.SERVICE_URL).getValue()+"lucene?method=addAll&SERVICE_PWD="+Cache.getSetting(Const.SERVICE_PWD).getValue());
    	    firstmenu.add(b5);
    	    MenuListBean b6=new MenuListBean("StaticData");
    	    b6.addLink("分类列表", "manageStaticdataList");
    	    b6.addLink("所有数据", "manageStaticdataList?spcode=ALL");
    	    firstmenu.add(b6);
    	    //MenuListBean b7=new MenuListBean("地址管理");
    	}
    }
}
